package com.afteryuan.server.game.handler;

import com.afteryuan.server.ConnectSession;
import com.afteryuan.server.command.up.CommandUp;
import com.afteryuan.server.data.Room;
import com.afteryuan.server.game.command.down.EquipChangeDown;
import com.afteryuan.server.game.command.up.EquipChangeUp;
import com.afteryuan.server.handler.Handler;
import com.afteryuan.server.service.SpriteService;

public class EquipChangeHandler implements Handler {

	public SpriteService spriteService;
	
	public void setSpriteService(SpriteService spriteService) {
		this.spriteService = spriteService;
	}

	public void process(ConnectSession session, CommandUp command) {
		EquipChangeUp cmd = (EquipChangeUp)command;
		
		EquipChangeDown down = new EquipChangeDown();
		down.equipId = cmd.equipId;
		down.playerId = cmd.playerId;
		down.setHandler();
		spriteService.broadcast(new Room(cmd.sceneId,cmd.sceneInstanceId),down);
	}

}
